home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
coding
/
80x86
/
code32.lzh
/
INDXBYTE.RT
< prev
next >
Wrap
Text File
|
1993-01-09
|
732b
|
30 lines
public _indexbyte
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
; Find a byte in a counted string and return index
; In:
; AL - byte to find
; EDX -> string of bytes, first byte is length
; Out:
; CF=1 - not found
; CF=0 - found
; EAX - index
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
_indexbyte:
push edi
push ecx
lea edi,[edx+1]
movzx ecx,byte ptr [edx]
repnz scasb
jnz short indexbytef0
movzx eax,byte ptr [edx]
sub eax,ecx
dec eax
jmp short indexbytef1
indexbytef0:
stc
indexbytef1:
pop ecx
pop edi
ret